package com.example.guiguihomemedical.mapper;

import com.example.guiguihomemedical.entity.Record;
import com.example.guiguihomemedical.entity.Signing;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RecordListMapper {
    @Select("select*from record")
    List<Record> getRecordArgs();

    @Select("select * from record where idcard=#{idCard} ")
    Record getRecordById(String idCard);

    @Select("select * from signing where idcard=#{idcard} order by endtime desc limit 1")
    Signing getEndTimeById(String idcard);

    @Select("select lc.name from userclassification uc inner join listenerclustering lc on uc.peopleid = lc.id where " +
            "idcard=#{idcard}")
    List<String> getListenerNamesById(String idcard);

    @Select("select count(*) from record")
    Integer getRecordTotal();
}
